package com.aaa.controller;

import com.aaa.entity.query.RentOverdueQuery;
import com.aaa.entity.result.Result;
import com.aaa.service.RentOverdueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：陈凯歌
 * @date ：Created in 2021/2/2 17:31
 * @description：租金逾期管理
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("/overdue")
public class RentOverdueController {

    @Autowired
    private RentOverdueService service;

    /**
     * 租金逾期分页+模糊查询
     * @param query
     * @return
     */
    @PostMapping("/page")
    public Result getPage(@RequestBody RentOverdueQuery query){

        return service.getPage(query);
    }

    /**
     * 细粒度操作根据id查询所有
     * @return
     */
    @PostMapping("/list")
    public Result ListAll(Integer id){

        return service.listAll(id);
    }

    /**
     * 根据id删除
     * @param id
     * @return
     */
    @PostMapping("/del")
    public Result del(Integer id){

        return service.delOverdue(id);
    }


}
